﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using cludg.Web.Core.Modules;
using cludg.Infrastructure.DI;

namespace cludg.Web.RateContentModule
{
	public class RateContentModule : IModule
	{
		public string ModuleName
		{
			get { return "cludg.Web.RateContentModule"; }
		}

		public void LoadModule(ApplicationContext context)
		{
			context.Container.Register<
				cludg.Repository.NHibernate.Extensions.INHMappingExtensionProvider,
				Extensions.NHMappingExtensionProvider>(ModuleName, DILifetime.PerResolve);
			context.Container.Register<
				cludg.Web.Core.ViewModels.Extensions.IViewModelExtensionProvider,
				Extensions.ViewModelExtensionProvider>(ModuleName, DILifetime.Singleton);
			context.Container.Register<
				cludg.Web.Core.Views.Extensions.IViewExtensionProvider,
				Extensions.ViewExtensionProvider>(ModuleName, DILifetime.PerResolve);
			context.Container.Register<
				cludg.Web.Core.ControllerFactory.IControllerProvider,
				Extensions.ControllerProvider>(ModuleName, DILifetime.PerResolve);
			context.Container.Register<
				Repository.IRateRepository, Repository.NHibernate.RateRepository>(DILifetime.Singleton);
			context.Container.Register<Services.RateService>(DILifetime.Singleton);
			context.Container.Register<cludg.Services.Security.Permissions.IPermissionProvider, Extensions.PermissionProvider>(ModuleName, DILifetime.PerResolve);
		}
	}
}